<include file="Public/header"/>
<div class="row">
  <div class="col-md-12">
    <div class="ibox float-e-margins">
      <div class="ibox-title">
        <h5>投诉列表</h5>
        <div class="row">
        </div>
      </div>
        <div class="list item">
          <!--交易列表-->
          <table class="layui-table" lay-data="{width:'100%',limit:<{$rows}>,id:'userData'}">
            <thead>
            <tr>
              <th lay-data="{field:'ddlx', width:130}">ID</th>
              <th lay-data="{field:'content',width:1240}">投诉内容</th>
              <th lay-data="{field:'pay_status',width:150}">状态</th>
              <th lay-data="{field:'caozuo',width:130}">操作</th>
            </tr>
            </thead>
            <tbody>
              <volist name="log" id="vo">
                <tr>
                  <td><{$vo['id']}></td>
                  <td><{$vo['json_content']}></td>
                  <td>
                    <switch name="vo.status">
                      <case value="0"><span style="color:#F00;">未处理</span></case>
                      <case value="1"><span style="color:#06F;">已处理</span></case>
                      <default />
                    </switch>
                  </td>
                  <td>
                    <if condition="$vo['status'] eq 1">
                      <a class="layui-btn layui-btn-warm layui-btn-mini">已处理</a>
                    </if>
                    <if condition="$vo['status'] eq 0">
                      <a class="layui-btn layui-btn-warm layui-btn-mini" onclick="submitPayment(this, '<{$vo[id]}>')" >处理</a>
                    </if>
                  </td>
                </tr>
              </volist>
            </tbody>
          </table>
          <!--交易列表-->
          <div class="page">
            <{$page}>
          </div>
        </div>
      </div>
    </div>

  </div>
  <include file="Public/footer"/>
  <script src="/Public/Front/js/echarts.common.min.js"></script>
  <script>
      layui.use(['laydate', 'laypage', 'layer', 'table', 'form'], function() {
          var laydate = layui.laydate //日期
              , laypage = layui.laypage //分页
              ,layer = layui.layer //弹层
              ,form = layui.form //表单
              , table = layui.table; //表格
          //日期时间范围
          laydate.render({
              elem: '#createtime'
              , type: 'datetime'
              ,theme: 'molv'
              , range: '|'
          });
          //日期时间范围
          laydate.render({
              elem: '#successtime'
              , type: 'datetime'
              ,theme: 'molv'
              , range: '|'
          });
      });
      function submitPayment(obj, id) {
          $.ajax({
              url: "<{:U('StatManage/editStatus',array(), false)}>",
              type: 'post',
              data: {'id':id },
              success: function (res) {
                  if (res.status == 1) {
                      layer.msg('处理成功!', {icon: 1, time: 1000},function () {
                          location.replace(location.href);
                      });
                  }else{
                      layer.msg(res.msg, {icon: -1, time: 4000},function () {
                          // location.replace(location.href);
                      });
                  }
              }
          });
      }
  </script>
  </body>
  </html>